﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public enum CmdOperation
{
    Stop = 1,
    MoveToAngle = 2,    //Param1:移动速度,Param2:旋转速度 Param3,Param4:方向向量
    Move = 3,           //Param3:旋转方向
}

public struct BumperCommand
{
    public ulong FrameIndex;
    public ulong ObjectID;
    public ushort CommandOperation;
    public int Param1;
    public int Param2;
    public int Param3;
    public int Param4;
}

public class BumperCommands
{
    private static  BumperCommands _instance;
    public static  BumperCommands Instance()
    {
        return BumperCommands._instance ?? (BumperCommands._instance = new BumperCommands());
    }
    private Queue<BumperCommand> _cmds;
    private BumperCommands()
    {
        _cmds = new Queue<BumperCommand>();
    }

    public void Push(BumperCommand cmd)
    {
        this._cmds.Enqueue(cmd);
    }

    public BumperCommand Pop()
    {
        return this._cmds.Dequeue();
    }

    public int Size()
    {
        return _cmds.Count;
    }
}